package cn.szzsi.model.mall;
import cn.szzsi.common.util.CommonUtil;
import com.jfinal.plugin.activerecord.Db;
import org.apache.commons.codec.digest.DigestUtils;

/**
 * 实体类 - 会员
 */
public class Member extends BaseMember<Member> {
    private static final long serialVersionUID = 1312507976941245078L;
    public static final Member dao = new Member().use(CommonUtil.ZSHOP_MALL).dao();


    /**
     * 根据用户名获取会员对象，若会员不存在，则返回null（不区分大小写）
     */
    public Member getBusinessByUsername(String username) {//验证商户
        return dao.findFirst("select * from mall_member where username = ? and shopId ='0' ", username);
    }


    /**
     * 根据手机号获取会员对象(平台)
     * @param phone
     */
    public Member getByPhone(String phone){
        return dao.findFirst("select * from mall_member where phone = ?", phone);
    }

}
